package com.zxp.springsecurity;

import com.zxp.springsecurity.entity.User;
import com.zxp.springsecurity.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import java.util.List;

/**
 * Copyright: Copyright (c) 2022 Asiainfo
 *
 * @ClassName: com.zxp.springsecurity.testMapper
 * @Description: 该类的功能描述
 * @version: v1.0.0
 * @author: 炫沙糖桔的鹏仔
 * @date: 2022/8/8 16:54
 * <p>
 * Modification History:
 * Date         Author          Version            Description
 * ------------------------------------------------------------
 * 2022/8/8      炫沙糖桔的鹏仔          v1.0.0               修改原因
 */
@SpringBootTest
public class testMapper {
    @Autowired
    UserService userService;
    @Test
    public void test() {
        List<User> list = userService.list();
        System.out.println(list);
    }

    @Test
    public void test1() {
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        String encode = encoder.encode("123456");
        System.out.println(encode);
        boolean matches = encoder.matches("123456", encode);
        System.out.println(matches);
    }

}
